package org.formal.system.shiro.manager;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;
/**
 * 加密类
 * @author jiangyan
 *
 */
public class PasswordHelper {
	private static String algorithmName = "md5";
	private static String  frontSalt = "#/QW?EROASDFGHJL";
	private static int hashIterations = 2;

	public static String  encryptPassword(String password, String salt) {
		String newPassword = new SimpleHash(
				algorithmName, password,  ByteSource.Util.bytes(salt),
				hashIterations).toHex();
		return newPassword;
	}

	public static  String decryptPasswordByAES(String password){
        return AESUtils.decryptData(password);
    }

	public static void main(String[] args) {
		String password = encryptPassword("1", "admin");
		System.out.println(password);
	}
}
